#include <iostream>
#include<map>
#include<math.h>
using namespace std;
bool check(int val)
{
    map<int, int> mp;
    map<int, int>::iterator it;
    int sum = 0;
    for (int i = 2; i < sqrt(val); ++i)
    {
        if (val % i == 0)
            mp[i] = val / i;
    }

    for (it = mp.begin(); it != mp.end(); ++it)
    {
        sum += it->first + it->second;
    }
    return (sum + 1) == val;
}
int main() {
    int n;
    int count = 0;
    cin >> n;
    for (int i = 2; i <= n; ++i)
    {
        if (check(i))
            count++;
    }
    cout << count;
}